<?
session_start();

require_once('config.php');
require_once('class/cls_product.php');
require_once('right.php');
require_once('class/cls_sales.php');
require_once('class/cls_coordinator.php');


$coordinator    = new cls_coordinator();
$product		= new cls_product();
$sales			= new cls_sales();
$right 			= new right();

$coordinator_id		= $_REQUEST['coordinator_id'];

if (isset($_REQUEST['rid']))
        {
			 $sales->delete_product_list($_REQUEST['rid']);

        }

if (isset($_REQUEST['discard']))

{

		$sales->delete_usertrack();
		session_destroy();
		unset($_SESSION['id']);
		header("Location: index.php");
		exit();
}

if (isset($_REQUEST['confirm']))

{

		header("Location: thankyou.php");
		exit();
}

//$sales->get_usertrack_salesinfo();

//$sales->delete_usertrack();

	
?>
<html>
<head>

<title>Always New Fashion</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="bg_sty.css" rel="stylesheet" type="text/css">

<link href="um_sty.css" rel="stylesheet" type="text/css"><style type="text/css">
<!--
.style23 {
	font-size: 24px;
	color: #0A1C7E;
	font-weight: bold;
	font-family: Tahoma, Arial, Verdana;
}
-->
</style></head>



<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#F7F9F0">



<table id="Table_01" width="760" border="0" cellpadding="0" cellspacing="0" align="center">

	<tr>

		<td>

<div align="center">
  <table id="Table_01" width="775" height="32" align="center" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="233" height="32"><img src="images/banner.jpg" width="775" height="100" alt=""></td>
      
    </tr>
  </table>
</div>

<div align="center">

<table id="Table_02" width="775" height="24" align="center" bgcolor="#000000" border="0" cellpadding="0" cellspacing="0">

	<tr>

		<td width="544" align="left" valign="middle">

		&nbsp;&nbsp;nbsp;&nbsp;&nbsp;<a  href="index.php" class="ummenu" >Home</a>		

		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		
		<a href="customer_service.php" class="ummenu">Customer Services</a>
		
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

		<a href="contact_us.php" class="ummenu">Contact Us</a>
		
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

		<a href="aboutus.php" class="ummenu">About Us</a>

		

		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>

		<td width="231" height="24" align="right" valign="middle"><a href="http://66.94.233.46/babelfish/trurl_pagecontent?lp=en_ja&trurl=http%3a%2f%2fwww.umgroups.com">

		</a>&nbsp;&nbsp;

		<a href="http://66.94.233.46/babelfish/trurl_pagecontent?lp=en_zt&trurl=http%3a%2f%2fwww.umgroups.com">		</a>&nbsp;&nbsp;

		<a href="http://66.94.233.46/babelfish/trurl_pagecontent?lp=en_ko&trurl=http%3a%2f%2fwww.umgroups.com">		</a>&nbsp;&nbsp;&nbsp;&nbsp;</td>
	</tr>

</table>

</div>

</td>

	</tr>

	<tr>
	  <td>

			<table width="775" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC" align="center">

				<tr><td colspan="7" height="20"></td>
				</tr>

				<tr>

					<td width="5" ></td>

					<td width="154" rowspan="3" valign="top" class="qcontact" style="padding-left: 4px; padding-top: 40px;"><div align="left">
					  <table id="table1" align="center" bgcolor="#FFFFFF" border="0" cellpadding="0" cellspacing="0">
                        <?
		
		//echo "jjj".$_SESSION['username'];
  		$object = $coordinator->get_coordinator();
		//echo "<pre>";
		//print_r ($object);
		//echo "</pre>";
		if (count($object) > 0)
		{
			foreach ($object as $row) {
?>
                        <tr>
                          <td width="40" height="28"><img src="main-img/<?= $row['coordinator_id'].".jpg" ?>" width="40" height="28"></td>
                          <td height="28"><div class="introLinks"> <a href="um_products.php?coordinator_id=<?= $row['coordinator_id']  ?>"> <img alt="" src="images/trans.gif" border="0" height="8" width="120"><br>
                            &nbsp; <span style="text-transform: uppercase">
                              <?= $row['coordinator_name']?>
                            </span></a></div></td>
                        </tr>
                        <tr>
                          <td height="20px"></td>
                        </tr>
                        <tr>
                          <td colspan="2"><img alt="" src="images/trans.gif" border="0" height="2" width="1"></td>
                        </tr>
                        <?			}//for
		}//if
		

		?>
                      </table>
					</div>				  </td>

					<td width="11"></td>

				  <td  align="center" valign="top" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="45px" align="center">&nbsp;</td>
                    </tr>
                   
                    <tr>
                      <td><table style="border-collapse: collapse; " align="center" border="1" bordercolor="#304c01" cellpadding="3" cellspacing="2" width="570">
                        <tbody>
                          <tr bgcolor="#003300" class="title1">
                            <td align="center"><font color="#ffffff">Brand</font></td>
                            <td align="center"><font color="#ffffff">Type</font></td>
                            <td align="center"><font color="#ffffff">Qty</font></td>
                            <td align="center"><font color="#ffffff">Unit Price</font></td>
                            <td align="center"><font color="#ffffff">Total Price</font></td>
                            <td width="72" align="center">&nbsp;</td>
                          </tr>
                          <?
		$object = $sales->get_salesinfo($_SESSION['id']);
		
		if (count($object) > 0)
		{
			foreach ($object as $row) {
?>
                          <tr>
                            <td><input type="hidden" name="id" value="<?= $row['coordinator_id']?>">
							<?= $row['brand'] ?></td>
                            <td><?= $row['type'] ?></td>
                            <td align="center"><?= $row['qty'] ?></td>
                            <td align="right"><?= $row['coordinator_id'] ?>&nbsp;$<?= $row['unitprice'] ?></td>
                            <td align="right">$<?= $row['total'] ?></td>
                            <td><a href="<? $_SERVER['PHP_SELF'] ?>?rid=<?= $row['id'] ?>" onClick="return confirm('Are you sure you want to delete?')"><img src="um-img/remove.jpg"></a></td>
                          </tr>
                          <?									  }//for
		}//if		 

?>
                          
                          <tr>
                            <td colspan="4" align="right" height="45"><font color="#000000">
                              <? $object = $sales->grand_total($_SESSION[id]); ?>
                              <strong>Grand Total</strong></font></td>
                            <td align="right">$<? echo "$object"; ?></td>
                            <td align="right">&nbsp;</td>
                          </tr>
                        </tbody>
                      </table></td>
                    </tr>
                  </table>
			      <br></td>
				  <td width="11"></td>
				</tr>
				<tr>
				  <td ></td>
				  <td></td>
				  <td height="30" align="center" valign="bottom" style="padding-right:5px;"><div align="right"><a href="<?= $_SERVER['PHP_SELF'] ?>?confirm">Confirm</a></div></td>
			  </tr>
	    </table>
		  
	  </td>

	</tr>

	<tr>

		<td>

		<table border="0" cellpadding="0" cellspacing="0" width="760" id="table15" bgcolor="#FFFFFF" height="100%">

			<tr>

				<td class="copy">

				

<table align="center" border="0" cellpadding="0" cellspacing="0" width="775" id="table6" bgcolor="#FFFFFF" style="border-bottom: 3px solid #DF8A0B; border-left: 1px solid #CCCCCC; border-right: 1px solid #CCCCCC">
	<tr bgcolor="#CCCCCC">
	  <td width="100%" height="2" class="copy" style="padding-left: 3px"></td>
	  </tr>

	<tr>
	  
	  <td height="30" class="foot">&nbsp;</td>
	  </tr>
</table>



</td>

			</tr>

		</table></td>

	</tr>

</table>





</body>



</html>